# Makefile for maze-rays

CC = gcc
LIBS = $(shell sdl-config --libs) -lSDL_ttf -lm
CFLAGS = $(shell sdl-config --cflags)

TARGET = maze-rays
SOURCES = src/main.c src/player.c src/maze.c
HEADERS = src/main.h src/player.h src/maze.h src/types.h
OBJS = src/main.o src/player.o src/maze.o

all:  $(TARGET)

$(TARGET):  $(OBJS)
	$(CC) -o $(TARGET) $(OBJS) $(LIBS)

$(OBJS):  $(SOURCES) $(HEADERS)

src/%.o:  %.c
	$(CC) -c -o $@ $(CFLAGS) $<

clean:
	-rm -f $(TARGET) $(OBJS)
